<include file="public/layout"/>
<style type="text/css">html, body {
    overflow: visible;
}</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer"
     style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="微信公众号配置"><i
                class="fa fa-arrow-circle-o-left"></i></a>

            <div class="subject"><h3>添加图文回复</h3>        <h5>添加或编辑文本回复内容</h5></div>
        </div>
    </div>
    <form class="form-horizontal" method="post" id="handlepost" action="">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit"><label>供应商</label></dt>
                <dd class="opt">
                    <div class="sDiv2"><select name="suppliers" class="small form-control">
                        <option value="0">请选择供应商</option>
                        <volist name="suppliers" id="vo">
                            <option
                            <if condition="$vo['select']">selected</if>
                            value="{$vo.suppliers_id}">{$vo.suppliers_name}</option>              </volist>
                    </select></div>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label><em>*</em>关键词</label></dt>
                <dd class="opt"><input type="text" name="keyword" id="keyword" value="{$keyword.keyword}"
                                       class="input-txt"></dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label for="cate_id"><em>*</em>标题</label></dt>
                <dd class="opt"><input type="text" name="title" value="{$keyword.title}" class="input-txt"></dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label><em>*</em>URL</label></dt>
                <dd class="opt"><input type="text" class="input-txt" name="url" placeholder="http://"
                                       value="{$keyword.url}"/></dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label><em>*</em>封面图片</label></dt>
                <dd class="opt">
                    <div class="input-file-show" id="divComUploadContainer"><span class="show">		          	<a
                            class="nyroModal" rel="gal" href="#"> <i class="fa fa-picture-o"
                                                                     onmouseover="showPreImage(this, 'pic')"
                                                                     onmouseout="closePreImage()"></i> </a>	           	</span>
                        <span class="type-file-box">            	            <input type="text" name="pic" id="pic"
                                                                                       value="{$keyword.pic}"
                                                                                       class="type-file-text">            	            <input
                                type="button" class="type-file-button" onClick="GetUploadify(1,'pic','weixin','')"
                                value="上传图片"/>           	            </span></div>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label><em>*</em>简介</label></dt>
                <dd class="opt"><textarea name="desc" rows="6" placeholder="简介" class="tarea" id="subject_desc">{$keyword.desc}</textarea>
                </dd>
            </dl>
            <input type="hidden" value="{$keyword.id}" name="kid">

            <div class="bot"><a href="JavaScript:void(0);" onClick="formSubmit()" class="ncap-btn-big ncap-btn-green"
                                id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">  $(document).ready(function () {
    $("#handlepost").validate({
        debug: true,
//调试模式取消submit的默认提交功能
 		focusInvalid: false,
//当为false时，验证无效时，没有焦点响应
    onkeyup: false,
            submitHandler: function(form){
//表单提交句柄,为一回调函数，带一个参数：form
           form.submit();
//提交表单
  },
        ignore:":button",
//不验证的元素
   rules:{
       keyword:{
           required:true
       },
       title:{
           required:true
       },
       url:{
           required:true
       },
       pic:{
           required:true
       },
       desc:{
           required:true
       }
   },
        messages:{
            keyword:{
                required:"请填写公众号名称"
            },
            title:{
                required:"请填写token"
            },
            url:{
                required:"请填写URL"
            },
            pic:{
                required:"请上传封面图片"
            },
            desc:{
                required:"请填写简介"
            }
        }
    });
});
function formSubmit(){
    $("#handlepost").submit();
}
</script>
</body></html>